<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width,initial-scale=1" />
  <title>后台 - 图书管理</title>
  <link rel="stylesheet" href="/static/styles.css">
</head>
<body>
  <h1>后台管理页面</h1>
  <p><a href="/static/index.html">返回入口</a></p>

  <section>
    <h2>添加 / 编辑图书</h2>
    <form id="bookForm">
      <input type="hidden" id="bookId">
      <input id="title" placeholder="书名" required>
      <input id="author" placeholder="作者" required>
      <input id="isbn" placeholder="ISBN">
      <input id="publishYear" type="number" placeholder="出版年份">
      <label>可借:
        <select id="available"><option value="true">是</option><option value="false">否</option></select>
      </label>
      <button type="submit">保存</button>
    </form>
  </section>

  <section>
    <h2>书籍列表</h2>
    <table>
      <thead><tr><th>书名</th><th>作者</th><th>ISBN</th><th>出版年份</th><th>可借</th><th>操作</th></tr></thead>
      <tbody id="bookList"></tbody>
    </table>
  </section>

  <section>
    <h2>借阅记录（全部）</h2>
    <table>
      <thead><tr><th>ID</th><th>书名</th><th>读者</th><th>借出</th><th>到期</th><th>已归还</th></tr></thead>
      <tbody id="allBorrowList"></tbody>
    </table>
  </section>

  <section>
    <h2>统计</h2>
    <button id="refreshStats">刷新统计</button>
    <pre id="overview"></pre>
    <h3>热门借阅</h3>
    <ol id="topBorrowed"></ol>
  </section>

  <script src="/static/admin.js"></script>
</body>
</html>